package java56_5;

import java.util.Scanner;

public class NoRepeatArray {

	public static void main(String[] args) {
		int[] a = new int[10];
		Scanner in = new Scanner(System.in);
		System.out.println("请输入10个数：");
		for (int i = 0; i < a.length;) {
			int number = in.nextInt();
			boolean s = false;// 不重复
			for (int j = 0; j < i; j++) {
				if (number == a[j]) {
					System.out.println("有重复，请再输：");
					s = true;
					break;
				}
			}
			if (s == false) {
				a[i++] = number;
				// i++;
			}
		}
		for (int j = 0; j < 10; j++)
			System.out.println(a[j]);
	}

}
